home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat3 / Tcl / exec.z / exec
Encoding:
Text File  |  1998-10-30  |  9.0 KB  |  199 lines

  1.  
  2.  
  3.  
  4. eeeexxxxeeeecccc((((3333TTTTccccllll))))                                                          eeeexxxxeeeecccc((((3333TTTTccccllll))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      exec - Invoke subprocess(es)
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      eeeexxxxeeeecccc ?_s_w_i_t_c_h_e_s? _a_r_g ?_a_r_g ...?
  13.  
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      This command treats its arguments as the specification of one or more
  17.      subprocesses to execute.  The arguments take the form of a standard shell
  18.      pipeline where each _a_r_g becomes one word of a command, and each distinct
  19.      command becomes a subprocess.
  20.  
  21.      If the initial arguments to eeeexxxxeeeecccc start with ---- then they are treated as   |
  22.      command-line switches and are not part of the pipeline specification.    |
  23.      The following switches are currently supported:
  24.  
  25.      ----kkkkeeeeeeeeppppnnnneeeewwwwlllliiiinnnneeee Retains a trailing newline in the pipeline's output.        |
  26.                   Normally a trailing newline will be deleted.
  27.  
  28.      --------           Marks the end of switches.  The argument following this one |
  29.                   will be treated as the first _a_r_g even if it starts with a ----.
  30.  
  31.      If an _a_r_g (or pair of _a_r_g's) has one of the forms described below then it
  32.      is used by eeeexxxxeeeecccc to control the flow of input and output among the
  33.      subprocess(es).  Such arguments will not be passed to the subprocess(es).
  34.      In forms such as ``< _f_i_l_e_N_a_m_e'' _f_i_l_e_N_a_m_e may either be in a separate     |
  35.      argument from ``<'' or in the same argument with no intervening space    |
  36.      (i.e. ``<_f_i_l_e_N_a_m_e'').
  37.  
  38.      |              Separates distinct commands in the pipeline.  The standard
  39.                     output of the preceding command will be piped into the
  40.                     standard input of the next command.
  41.  
  42.      |&             Separates distinct commands in the pipeline.  Both
  43.                     standard output and standard error of the preceding
  44.                     command will be piped into the standard input of the next
  45.                     command.  This form of redirection overrides forms such as
  46.                     2> and >&.
  47.  
  48.      < _f_i_l_e_N_a_m_e     The file named by _f_i_l_e_N_a_m_e is opened and used as the
  49.                     standard input for the first command in the pipeline.
  50.  
  51.      <@ _f_i_l_e_I_d      _F_i_l_e_I_d must be the identifier for an open file, such as   |
  52.                     the return value from a previous call to ooooppppeeeennnn.  It is used|
  53.                     as the standard input for the first command in the        |
  54.                     pipeline.  _F_i_l_e_I_d must have been opened for reading.
  55.  
  56.      << _v_a_l_u_e       _V_a_l_u_e is passed to the first command as its standard
  57.                     input.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. eeeexxxxeeeecccc((((3333TTTTccccllll))))                                                          eeeexxxxeeeecccc((((3333TTTTccccllll))))
  71.  
  72.  
  73.  
  74.      > _f_i_l_e_N_a_m_e     Standard output from the last command is redirected to the
  75.                     file named _f_i_l_e_N_a_m_e, overwriting its previous contents.
  76.  
  77.      2> _f_i_l_e_N_a_m_e    Standard error from all commands in the pipeline is       |
  78.                     redirected to the file named _f_i_l_e_N_a_m_e, overwriting its    |
  79.                     previous contents.
  80.  
  81.      >& _f_i_l_e_N_a_m_e    Both standard output from the last command and standard   |
  82.                     error from all commands are redirected to the file named  |
  83.                     _f_i_l_e_N_a_m_e, overwriting its previous contents.
  84.  
  85.      >> _f_i_l_e_N_a_m_e    Standard output from the last command is redirected to the
  86.                     file named _f_i_l_e_N_a_m_e, appending to it rather than
  87.                     overwriting it.
  88.  
  89.      2>> _f_i_l_e_N_a_m_e   Standard error from all commands in the pipeline is       |
  90.                     redirected to the file named _f_i_l_e_N_a_m_e, appending to it    |
  91.                     rather than overwriting it.
  92.  
  93.      >>& _f_i_l_e_N_a_m_e   Both standard output from the last command and standard   |
  94.                     error from all commands are redirected to the file named  |
  95.                     _f_i_l_e_N_a_m_e, appending to it rather than overwriting it.
  96.  
  97.      >@ _f_i_l_e_I_d      _F_i_l_e_I_d must be the identifier for an open file, such as   |
  98.                     the return value from a previous call to ooooppppeeeennnn.  Standard  |
  99.                     output from the last command is redirected to _f_i_l_e_I_d's    |
  100.                     file, which must have been opened for writing.
  101.  
  102.      2>@ _f_i_l_e_I_d     _F_i_l_e_I_d must be the identifier for an open file, such as   |
  103.                     the return value from a previous call to ooooppppeeeennnn.  Standard  |
  104.                     error from all commands in the pipeline is redirected to  |
  105.                     _f_i_l_e_I_d's file.  The file must have been opened for        |
  106.                     writing.
  107.  
  108.      >&@ _f_i_l_e_I_d     _F_i_l_e_I_d must be the identifier for an open file, such as   |
  109.                     the return value from a previous call to ooooppppeeeennnn.  Both      |
  110.                     standard output from the last command and standard error  |
  111.                     from all commands are redirected to _f_i_l_e_I_d's file.  The   |
  112.                     file must have been opened for writing.
  113.  
  114.      If standard output has not been redirected then the eeeexxxxeeeecccc command returns
  115.      the standard output from the last command in the pipeline.  If any of the
  116.      commands in the pipeline exit abnormally or are killed or suspended, then
  117.      eeeexxxxeeeecccc will return an error and the error message will include the
  118.      pipeline's output followed by error messages describing the abnormal
  119.      terminations; the eeeerrrrrrrroooorrrrCCCCooooddddeeee variable will contain additional information
  120.      about the last abnormal termination encountered.  If any of the commands
  121.      writes to its standard error file and that standard error isn't
  122.      redirected, then eeeexxxxeeeecccc will return an error;  the error message will
  123.      include the pipeline's standard output, followed by messages about
  124.      abnormal terminations (if any), followed by the standard error output.
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. eeeexxxxeeeecccc((((3333TTTTccccllll))))                                                          eeeexxxxeeeecccc((((3333TTTTccccllll))))
  137.  
  138.  
  139.  
  140.      If the last character of the result or error message is a newline then
  141.      that character is normally deleted from the result or error message.
  142.      This is consistent with other Tcl return values, which don't normally end
  143.      with newlines.  However, if ----kkkkeeeeeeeeppppnnnneeeewwwwlllliiiinnnneeee is specified then the trailing  |
  144.      newline is retained.
  145.  
  146.      If standard input isn't redirected with ``<'' or ``<<'' or ``<@'' then
  147.      the standard input for the first command in the pipeline is taken from
  148.      the application's current standard input.
  149.  
  150.      If the last _a_r_g is ``&'' then the pipeline will be executed in
  151.      background.  In this case the eeeexxxxeeeecccc command will return a list whose      |
  152.      elements are the process identifiers for all of the subprocesses in the  |
  153.      pipeline.  The standard output from the last command in the pipeline will
  154.      go to the application's standard output if it hasn't been redirected, and
  155.      error output from all of the commands in the pipeline will go to the
  156.      application's standard error file unless redirected.
  157.  
  158.      The first word in each command is taken as the command name; tilde-
  159.      substitution is performed on it, and if the result contains no slashes
  160.      then the directories in the PATH environment variable are searched for an
  161.      executable by the given name.  If the name contains a slash then it must
  162.      refer to an executable reachable from the current directory.  No ``glob''
  163.      expansion or other shell-like substitutions are performed on the
  164.      arguments to commands.
  165.  
  166.  
  167. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  168.      execute, pipeline, redirection, subprocess
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.